#待校验的数据
import jsonschema

JSON={
    "success": False,
    "code": 10000,
    "message": "xxx登录成功",
    "data": {
        "age": 20,
        "name": "lily"
    }
}

schema={"type":"object",
        "properties":{
            "success":{"type":"boolean"},
            "code":{"type":"integer"},
            "message":{"pattern":"登录成功$"}
 },
"data":{"type":"object",
"properties":{
    "name":{"const":"lily"},
    "age":{"const":20}
}
}
}
resp=jsonschema.validate(instance=JSON,schema=schema)
print(resp)